import store2 from 'store2';

const store = {
    state: {
        token: store2('setToken') ? store2('setToken') : ''
    },
    actions: {
        setToken(newState: { token: string }, action: { type: string, val: string }) {
            newState.token = action.val
        }
    },
    asyncActions: {
        
    },
    actionNames: {}
}

const actionNames = {};

for (let key in store.actions) {
    actionNames[key] = key
}

store.actionNames = actionNames

export default store